package com.centling.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.centling.tools.RestUtils;

/**
 * 总控开关信号Controller
 * 
 * @author cyril
 * @date 2017年5月4日
 * @version V1.0
 */
@Controller
@RequestMapping("/master")
public class MasterController {

	private final static String APPKEY = "9aa42320-0e3b-41fa-be8f-cccb45a6f089";
	private final static String URL = "https://192.168.0.202";
	
	//@Autowired
	//private GetConfig getConfig;
	
	/**
	 * 设置开始
	 * 
	 * @param code
	 */
	@RequestMapping("/start")
	@ResponseBody
	public Object setStart(String code){
		String params = "{\"startCode\":"+code+"}";
		RestUtils.sendPut(URL + "/Thingworx/Things/AGV2/Properties/startCode?appKey="+APPKEY, params);
		return code;
	}
	
}
